﻿app.factory('signupFactory', function ($http, base64Factory) {
    var factory = {};
    factory.postUser = function (dataPost) {
        return $http.post(createUserApiAddress, dataPost);
    };
    factory.checkEmail = function (dataPost) {
        $http.defaults.headers.common['Authorization'] = 'Basic ' + base64Factory.encode('checkinfo:check');
        return $http.post(checkEmailApiAddress, dataPost);
    };
    factory.checkUser = function (dataPost) {
        $http.defaults.headers.common['Authorization'] = 'Basic ' + base64Factory.encode('checkinfo:check');
        return $http.post(checkUserApiAddress, dataPost);
    };
    factory.sendPass = function (dataPost) {
        $http.defaults.headers.common['Authorization'] = 'Basic ' + base64Factory.encode('checkinfo:check');
        return $http.post(sendPassApiAddress, dataPost);
    };
    factory.acctiveAccount = function (id) {
        $http.defaults.headers.common['Authorization'] = 'Basic ' + base64Factory.encode('checkinfo:check');
        return $http.post(activeAccountApiAddress+ id);
    };
    return factory;
});